
public abstract class CaffeineBeverageWithHook 
{
    //metoda template
	public final void prepareRecipe()
    {
		boilWater();
		brew();
		pourInCup();
		if(customerWantsCondiments())
		{
		addCondiments();
		}
	}
	
	//metoda de preparare a bauturii
	public abstract void brew();
	
	//metoda de adaugare a condimentelor
	public abstract void addCondiments();
	
	//algoritmul COMUN de FIERBERE A APEI
	public void boilWater()
	{
		System.out.println("Boiling water");
	}
	
	//algoritmul COMUN de TUNARE A BAUTURII IN PAHARE
	public void pourInCup()
	{
		System.out.println("Pouring in a cup");
	}
	
	//Hook-ul standard de decizie a folosirii condimentelor
	public boolean customerWantsCondiments()
	{
		return true;
	}

}
